import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path:'/home',
    name:'home',
    component:() => import('@/views/home/home.vue')
  },
  {
    path:'/home/location',
    name:'location',
    component:() => import('@/views/home/location/location.vue')
  },
  {
    path:'/home/search',
    name:'homeSearch',
    component:() => import('@/views/home/search/search.vue')
  },
  {
    path:'/home/brand',
    name:'brand',
    component:() => import('@/views/home/brand/brand.vue')
  },
  {
    path:'/home/brand/detail',
    name:'brandDetail',
    component:() => import('@/views/home/brand/brandDetail.vue')
  },
  {
    path:'/home/goods',
    name:'goods',
    component:() => import('@/views/home/goodsList/goods.vue')
  },
  {
    path:'/topic',
    name:'topic',
    component:() => import('@/views/topic/topic.vue')
  },
  {
    path:'/topic/detail/:id',
    name:'topicDetail',
    component:() => import('@/views/topic/topicDetail/topicDetail.vue')
  },
  {
    path:'/category',
    name:'category',
    component:() => import('@/views/category/category.vue')
  },
  {
    path:'/category/list/:id',
    name:'secCategory',
    component:() => import('@/views/category/secCategory/secCategory.vue')
  },
  {
    path:'/category/detail/:id',
    name:'categoryDetail',
    component:() => import('@/views/category/categoryDetail/categoryDetail.vue')
  },
  {
    path:'/cart',
    name:'cart',
    component:() => import('@/views/cart/cart.vue')
  },
  {
    path:'/cart/sure',
    name:'pay',
    component:() => import('@/views/cart/pay/pay.vue')
  },
  {
    path:'/cart/addressPage',
    name:'addressPage',
    component:() => import('@/views/cart/addressPage/AddressPage.vue')
  },
  {
    path:'/cart/editaddressPage',
    name:'editAddress',
    component:() => import('@/views/cart/addressPage/editAddress.vue')
  },
  {
    path:'/user',
    name:'user',
    component:() => import('@/views/user/user.vue')
  },
  {
    path:'/user/collection',
    name:'collection',
    component:() => import('@/views/user/collection/collection.vue')
  },
  {
    path:'/user/submitAction',
    name:'submitAction',
    component:() => import('@/views/user/submitAction/submitAction.vue')
  },
  {
    path:'*',
    redirect:'/home'
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
